//表单
Cute.form = {	//表单
    bindDefault: function(obj) {
        if(!("placeholder" in document.createElement("input"))){
            $(obj || "input[placeholder],textarea[placeholder]").focus(function() {
                if (this.value == this.getAttribute("placeholder")) {
                    this.value = '';
                    $(this).removeClass("default");
                }
                //隐藏错误提示
                if ($(this).attr("ntype") == "password")
                    $(this).next().hide();

            }).blur(function() {
                if (this.value == '') {
                    this.value = this.getAttribute("placeholder");
                    $(this).addClass("default");
                    $(this).next().show();
                }
            }).val(function(){
                this.defaultValue = this.getAttribute("placeholder");
                return this.getAttribute("placeholder");
            }).addClass("default");
        }
    },
    bindFocus: function(obj) {
        if(!("focus" in document.createElement("input"))){
            $(obj || "input.text,textarea.textarea").focus(function() {
                $(this).addClass("focus");
            }).blur(function() {
                $(this).removeClass("focus");
            });
        }
    },
    isInputNull: function(obj) {
        obj = $(obj);
        if (obj.length == 0) return false;
        var _value = obj.val().trim();
        if (_value == "" || (_value == obj[0].defaultValue && obj.hasClass("default"))) {
            return true;
        }
        return false;
    }
};